import request from '@/router/axios'

//列表
export const getList = (current, size, params) => {
  return request({
    url: '/api/appConfig/page',
    method: 'get',
    params: {
      current,
      size,
      ...params
    }
  })
}

export const save = (data) => {
  return request({
    url: '/api/appConfig/submit',
    method: 'post',
    data
  })
}

export const remove = (id) => {
  return request({
    url: '/api/appConfig/remove',
    method: 'post',
    params: {
      id
    }
  })
}


export const getChildList = (params) => {
  return request({
    url: '/api/appConfigChild/list',
    method: 'get',
    params
  })
}

export const childSave = (data) => {
  return request({
    url: '/api/appConfigChild/submit',
    method: 'post',
    data
  })
}

export const childRemove = (id) => {
  return request({
    url: '/api/appConfigChild/remove',
    method: 'post',
    params: {
      id
    }
  })
}

export const getProductionLine = (params) => {
  return request({
    url: '/api/produceline/findAll',
    method: 'get',
    params
  })
}

// 获取工位
export const listByProductionLine = (params) => {
  return request({
    url: '/api/produceStation/listByProductionLine',
    method: 'get',
    params
  })
}

// 获取装配点
export const getAssemblyPoint = (params) => {
  return request({
    url: '/api/assemblyconfig/findAll',
    method: 'get',
    params
  })
}
